<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Wish_mdl extends CI_Model {
	

	public function __construct() {
		parent::__construct();

	}
	
	public function get_wish_by_id($id) {
		$this->db->where('id', $id);
		return $this->db->get('wish')->row_array();
	}
	
	public function get_wish_list() {		
		$this->db->order_by('id', 'desc');
		$query = $this->db->get('wish');
		return $query->result_array();
	}
	


	public function add_wish($data) {
		
		$this->db->insert('wish', $data);

		return ($this->db->insert_id()) ? $this->db->insert_id() : FALSE;
	}
	
	public function update_wish($id, $data) {
		$this->db->where('id', $id);
		$this->db->update('wish', $data);
		
	}
	
	public function remove_wish($id) {
		$data = array('is_del' => 1);
		$this->update_wish($id, $data);
	}

	
}